package net.oschina.git.hikoyan.helloapi.authentication;

import net.oschina.git.hikoyan.helloapi.shiro.jwt.authc.UserDefault;

import java.util.Set;

/**
 * Created by yan on 17/1/17.
 */
public class UserInfo implements UserDefault {

    private String userId;

    private String username;

    private String password;

    private Set<String> roles;

    public UserInfo(String userId, String username, String password) {
        this.userId = userId;
        this.username = username;
        this.password = password;
    }

    public Object getPrincipal() {
        return getUserId();
    }

    public Object getCredentials() {
        return getPassword();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setRoles(Set<String> roles) {
        this.roles = roles;
    }

    public Set<String> getRoles() {
        return roles;
    }
}
